:breaklights
// struct 0@
// handle 1@
// manager 2@
// driver 3@
// cam 4@ 5@ 6@
// nCorona 7@
// ret nCorona
// 0AB1: @breaklights 8 struct 0@ habdle 1@ damManager 2@ driver 3@ camXYZ 4@ 5@ 6@ nCoronaIn 7@ nCoronaOut 7@
if
    3@ > 0
then
    0A8E: 20@ = 0@ + 0x4A0 // stop
    0A8D: 20@ 20@ 4 0
    if
        20@ > 0.0
    then
        0AA8: call_function_memethod _getLightState struct 2@ num_params 1 pop 0 LIGHT_LEFT 21@
        0441: 8@ = car 1@ model
        if
            8A01: not model 8@ minimum_4wheels_vehicle
        then
            21@ = 0
        end
        if
            21@ <> 1
        then
            if
                0D0C: get_car 1@ component "breaklight_l" matrix_to 21@ // IF and SET
            then
                0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                21@ -= 0x10
                if
                    17@ < 0.0
                then
                    0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.3 with_offsets 21@ intensity 80 blue 0 green 0 red 150 to_vehicle_struct 0@ unical_number 7@
                    7@ += 1
                end
            end
            if
                0D0C: get_car 1@ component "breaklight_l_2" matrix_to 21@ // IF and SET
            then
                0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                21@ -= 0x10
                if
                    17@ < 0.0
                then
                    0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.3 with_offsets 21@ intensity 80 blue 0 green 0 red 150 to_vehicle_struct 0@ unical_number 7@
                    7@ += 1
                end
            end
            0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
            20@ += B_L
            0A8C: 20@ 1 1 0 // TURN ON
        else
            0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
            20@ += B_L
            0A8C: 20@ 1 2 0 // TURN ON              
        end    
        0AA8: call_function_memethod _getLightState struct 2@ num_params 1 pop 0 LIGHT_RIGHT 21@
        0441: 8@ = car 1@ model
        if
            8A01: not model 8@ minimum_4wheels_vehicle
        then
            21@ = 0
        end
        if
            21@ <> 1
        then
            if
                0D0C: get_car 1@ component "breaklight_r" matrix_to 21@ // IF and SET
            then
                0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                21@ -= 0x10
                if
                    17@ < 0.0
                then
                    0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.3 with_offsets 21@ intensity 80 blue 0 green 0 red 150 to_vehicle_struct 0@ unical_number 7@
                    7@ += 1
                end
            end
            if
                0D0C: get_car 1@ component "breaklight_r_2" matrix_to 21@ // IF and SET
            then
                0D07: get_coords 4@ 5@ 6@ offsets_relative_to_matrix 21@ store_to 16@ 17@ 18@
                21@ -= 0x10
                if
                    17@ < 0.0
                then
                    0AA5: _registerCorona 21 21 0 0 50.0 0 0.5 0 0 0 0 1 attach_corona_flare 0 type 1 150.0 radius 0.3 with_offsets 21@ intensity 80 blue 0 green 0 red 150 to_vehicle_struct 0@ unical_number 7@
                    7@ += 1
                end
            end
            0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
            20@ += B_R
            0A8C: 20@ 1 1 0 // TURN ON
        else
            0A8E: 20@ = 0@ + LIGHT_STATES_OFFSET
            20@ += B_R
            0A8C: 20@ 1 2 0 // TURN ON
        end
    end    
end
0AB2: ret 1 7@